* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
}

/* 头部导航 */
header {
    background-color: #333;
    color: white;
    padding: 1rem 0;
}

header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header nav h1 {
    margin: 0;
}

header nav h1 a {
    color: white;
    text-decoration: none;
    font-size: 1.5rem;
}

header nav .nav-links {
    display: flex;
    gap: 20px;
}

header nav .nav-links a {
    color: white;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

header nav .nav-links a:hover {
    background-color: #555;
}

/* 警告消息 */
.alert {
    padding: 15px;
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    margin-bottom: 20px;
}

/* 商品网格 */
.page-header {
    margin-bottom: 30px;
}

.page-header h2 {
    font-size: 2rem;
    color: #333;
    border-bottom: 2px solid #e91e63;
    padding-bottom: 10px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.product-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 1px solid #eee;
}

.product-info {
    padding: 20px;
}

.product-name {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: #333;
}

.product-price {
    font-size: 1.4rem;
    color: #e91e63;
    font-weight: bold;
    margin: 10px 0;
}

.product-stock .stock-in {
    color: #28a745;
    font-weight: bold;
}

.product-stock .stock-out {
    color: #dc3545;
    font-weight: bold;
}

.product-desc {
    color: #666;
    font-size: 0.9rem;
    margin: 15px 0;
    line-height: 1.4;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    text-decoration: none;
    transition: background-color 0.3s;
}

.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
    margin-left: 10px;
}

.btn-secondary:hover {
    background-color: #545b62;
}

.btn-buy {
    background-color: #28a745;
    color: white;
    padding: 12px 24px;
    font-size: 1.1rem;
    margin-top: 15px;
}

.btn-buy:hover {
    background-color: #218838;
}

.btn-disabled {
    background-color: #6c757d;
    color: white;
    cursor: not-allowed;
}

/* 商品详情页 */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin: 30px 0;
}

.product-image-large {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 8px;
}

.product-info h1 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: #333;
}

.price {
    font-size: 2.5rem;
    color: #e91e63;
    font-weight: bold;
    margin: 20px 0;
}

.stock .stock-in {
    font-size: 1.2rem;
    color: #28a745;
    font-weight: bold;
}

.stock .stock-out {
    font-size: 1.2rem;
    color: #dc3545;
    font-weight: bold;
}

.description {
    font-size: 1.1rem;
    line-height: 1.6;
    margin: 20px 0;
    color: #555;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }
    
    .product-detail {
        grid-template-columns: 1fr;
        padding: 20px;
    }
    
    header nav {
        flex-direction: column;
        gap: 15px;
    }
    
    .product-info .btn-buy,
    .product-info .btn-secondary {
        display: block;
        width: 100%;
        margin: 10px 0 0 0;
    }
}

/* 页脚 */
footer {
    background-color: #333;
    color: white;
    padding: 20px 0;
    margin-top: 50px;
}

footer .container {
    text-align: center;
    padding: 0;
}

footer p {
    margin: 0;
    font-size: 0.9rem;
}